extends Marker2D

@export var manager:Node2D
var twn1:Tween
var twn2:Tween
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	$Sprite2D.material=$Sprite2D.material.duplicate()
	twn1=create_tween()
	twn2=create_tween()
	twn1.tween_property($Sprite2D,"position",Vector2(0,-65),1)
	twn1.tween_property($Sprite2D,"position",Vector2(0,-85),1)
	twn1.set_loops()
	twn2.tween_callback(func():
		$Sprite2D.material.set_shader_parameter("time",0.0)
		)
	twn2.tween_property($Sprite2D.material,"shader_parameter/time",1,0.5)
	twn2.tween_property($Sprite2D.material,"shader_parameter/time",1,1.5)
	twn2.set_loops()
	modulate=Color("9c9c9c25")


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass


func _on_area_2d_area_entered(area: Area2D) -> void:
	if manager:
		if manager.player_spawn:
			manager.player_spawn.modulate=Color("9c9c9c25")
		manager.player_spawn=self
		self.modulate=Color("9c9c9c")
		print("set")
	
